{% extends 'news/fabu.html' %}

{% load static %}
{% block style %}
    <link rel="stylesheet" href="{% static 'news/css/fbnr.css' %}">

    <link rel="stylesheet" href="{% static 'news/css/forget.css' %}">
    <link rel="stylesheet" href="{% static 'news/css/log.css' %}">
{% endblock %}




{% block title %}
    发布内容
{% endblock %}


{% block top %}
    <div id="up">
        <div></div>发布内容
    </div>
{% endblock %}

{% block content %}
     <div id="a_down">
         <h3>{{ error_info }}</h3>
         <form action="{% url 'news:fbyz' %}" enctype="multipart/form-data" method='post'>
             {% csrf_token %}
             <div class="f2">
                 <h3>内容名称:</h3> <input type="text" name="title">
             </div>
             <div class="f3">
                 <h3>类型:</h3>
                 <input type="radio" value="1" name="class"><b>新闻</b>
                 <input type="radio" value="2" name="class"><b>政策</b>
                 <input type="radio" value="3" name="class"><b>行情</b>
                 <input type="radio" value="4" name="class"><b>技术</b>
             </div>
             <div class="f4">
                 <h3>作者:</h3>
                 <input type="text" name="authors">
             </div>
             <div class="f5">
                 <h3>来源:</h3>
                 <input type="text" name="source">
             </div>
             <div class="f6">
                 <h3>摘要</h3>
                 <input type="text" name="digist">
             </div>
             <div class="f7">
                 <h3>内容封面:</h3>
                 <input type="file" name='pic' value="">
                 <img src="" id="img">
             </div>
             <br>
             <div id="a_d_c">
                 <h3>稿件内容:</h3>
                 <span style="position: absolute; left: 525px; top: 650px;"><textarea name="content" cols="30" rows="10" ></textarea></span>
             </div>
             <input type="submit" value="发布" class="su" name="sub">
         </form>
     </div>


{#    <form action="" method="post" enctype="multipart/form-data">#}
{##}
{#        {{ form.as_p }}#}
{#        稿件内容:<textarea name="str" id="">good morning</textarea><br>#}
{#        <input type="submit" value = '发布'>#}
{#    </form>#}

{% endblock %}

{% block js %}
    <script src="/static/js/bootstrap1/js/bootstrap.js"></script>
    <script src="/static/js/tiny_mce/tiny_mce_src.js"></script>
    <script src="/static/js/ckeditor/ckeditor.js"></script>
    <script>

        tinymce.init({
            'mode': 'textareas',
            'theme': 'advanced',
            'width': 500,
            'height': 300,

        });




        {#图片#}
        $(function () {
            $('input[type="file"]').on('change',function () {
                var file = this.files[0];
                if (this.files && file) {
                    var reader = new FileReader();
                    reader.onload = function (e) {
                        $('#img').attr('src',e.target.result);
                    };
                    reader.readAsDataURL(file);
                }
            })
        });


    </script>
{% endblock %}